<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib uri="http://www.springframework.org/security/tags" prefix="security" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE HTML>
<html>
<head>
	<%@ include file="common/meta.jsp" %>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<meta name="viewport" content="width=device-width, initial-scale=1.0">
	<meta name="renderer" content="webkit">
	<meta http-equiv="Cache-Control" content="no-siteapp" />
	<title>互联网外联对接平台</title>
	<link rel="shortcut icon" href="${ctx}/img/icon.ico">
	<link href="${ctx}/css/bootstrap.min14ed.css?v=3.3.6" rel="stylesheet">
	<link href="${ctx}/css/font-awesome.min93e3.css?v=4.4.0" rel="stylesheet">
	<link href="${ctx}/css/animate.min.css" rel="stylesheet">
	<link href="${ctx}/css/style.min862f.css?v=4.1.0" rel="stylesheet">
	<link href="${ctx}/css/plugins/sweetalert/sweetalert.css" rel="stylesheet">
	<style type="text/css">
		nav.navbar-fixed-top{height: 61px; background-color: #2f4050;}
		.nav>li>a:focus, .nav>li>a:hover{background-color: rgba(0,0,0,.1);}
		.nav .open>a, .nav .open>a:focus, .nav .open>a:hover{background-color: rgba(0,0,0,.1);}
		.nav-active{background-color: rgba(0,0,0,.1);}
		.roll-right.btn-group{right:0;}
		.roll-right.J_tabRight{right:80px;}
		li.top-left-logo{font-size: 20px; color: #fff; padding: 16px 10px; font-family: '微软雅黑'; font-weight: bolder;}
		.fixed-nav #content-main{height: calc(100% - 43px);}
	</style>
</head>
<body  class="fixed-sidebar full-height-layout gray-bg  pace-done fixed-nav" style="overflow:hidden">
	<div id="wrapper">
		<!--左侧导航开始-->
		<nav class="navbar-default navbar-static-side" role="navigation">
			<div class="nav-close">
				<i class="fa fa-times-circle"></i>
			</div>
			<div  class="sidebar-collapse" >
				<ul class="nav" id="side-menu">
					<li class="active">
						<a class="J_menuItem" href="${contextPath}/system/gateway/main">
							<i class="fa fa-home"></i>
							<span class="nav-label">首页</span>
						</a>
                    </li> 
					<c:forEach  items="${menus}" var="item">
						<li>
						<a href="#">
							<c:if test="${item.menu.iconType == 1}">
								<i class="${item.menu.iconSource }"></i>
							</c:if>
							<span class="nav-label">${item.menu.name}</span>
							<span class="fa arrow"></span>
						</a>
						<ul class="nav nav-second-level">
							<c:forEach  items="${item.childMenus}" var="childMenu">
								<li>
									<a class="J_menuItem" href="${contextPath}${childMenu.functionUrl}">${childMenu.name}</a>
								</li>
							</c:forEach>
						</ul>
					</li>
					</c:forEach>
				</ul>
			</div>
		</nav>
		<!--左侧导航结束-->

		<div id="page-wrapper" class="gray-bg dashbard-1">
			<div class="row border-bottom">
				<!-- 顶部内容开始 -->
				<nav class="navbar navbar-fixed-top" role="navigation" style="margin-bottom: 0">
					<ul  class="nav navbar-top-links navbar-left">
						<a class="navbar-minimalize minimalize-styl-2 btn btn-white" href="#">
							<i class="fa fa-th-large" aria-hidden="true"></i>
						</a>
						<li class="top-left-logo">
							互联网外联对接平台
						</li>
					</ul>
					<ul class="nav navbar-top-links navbar-right">
						<security:authorize access="isAuthenticated()">
						<li class="dropdown hidden-xs">
							<a data-toggle="dropdown" class="nav-top-text" style="color: white;">
								欢迎您，<i class="fa fa-user-md"></i>
								<security:authentication property="principal.username"/>
								<b class="caret"></b>
							</a>
							<ul class="dropdown-menu animated fadeInDown m-t-xs">
								<li>
									<a class="J_menuItem" href="${contextPath}/system/user/tochangepassword">
										修改密码
									</a>
								</li>
								<li>
									<a class="J_menuItem" href="${contextPath}/system/user/userinfo">
										个人信息
									</a>
								</li>
								<li class="divider"></li>
								<li class="safe-logout">
									<a href="#">安全退出</a>
								</li>
                            </ul>
						</li>
						<li class="dropdown hidden-xs">
							<a class="safe-logout nav-top-text" href="#" style="color: white;">
								<i class="fa fa fa-sign-out"></i>安全退出
							</a>
						</li>
						</security:authorize>
						<security:authorize access="!isAuthenticated()">
						<li>
							<a href="${contextPath}/home" style="color: white;">
								<i class="fa fa-user-md"></i>
								亲，请登录！
							</a>
						</li>
						<li>
							<a href="login.html" style="color: white;">
								<i class="fa fa-sign-in"></i>免费入驻
							</a>
						</li>
						</security:authorize>
					</ul>
				</nav>
				<!-- 顶部内容结束 -->
			</div>
			<!-- 中央内容区Tab开始 -->
			<div class="row content-tabs">
				<button class="roll-nav roll-left J_tabLeft">
					<i class="fa fa-backward"></i>
				</button>
				<nav class="page-tabs J_menuTabs">
					<div class="page-tabs-content">
						<a href="javascript:;" class="active J_menuTab" data-id="${contextPath}/system/gateway/main">首页</a>
					</div>
				</nav>
				<button class="roll-nav roll-right J_tabRight">
					<i class="fa fa-forward"></i>
				</button>
				<div class="btn-group roll-nav roll-right">
					<button class="dropdown J_tabClose" data-toggle="dropdown">
						关闭操作
						<span class="caret"></span>
					</button>
					<ul role="menu" class="dropdown-menu dropdown-menu-right animated fadeInDown">
						<li class="J_tabCloseAll">
							<a>关闭全部选项卡</a>
						</li>
						<li class="J_tabCloseOther">
							<a>关闭其他选项卡</a>
						</li>
					</ul>
				</div>
			</div>
			<!-- 中央内容区Tab结束 -->
			<!-- 中央内容区开始 -->
			<div class="row J_mainContent" id="content-main">
				<iframe class="J_iframe" name="iframe0" width="100%" height="100%" src="${contextPath}/system/gateway/main"
						frameborder="0" data-id="${contextPath}/system/gateway/main" seamless></iframe>
			</div>
			<!-- 中央内容区结束 -->
		</div>
	</div>
	
	<!-- 用于子页面转向menu菜单 -->
	<a id="anchorHiddenMenuItem" class="J_menuItem" href="" style="display: none;"></a>
	
	<script src="${ctx}/js/jquery.min.js?v=2.1.4"></script>
	<script src="${ctx}/js/bootstrap.min.js?v=3.3.6"></script>
	<script src="${ctx}/js/plugins/metisMenu/jquery.metisMenu.js"></script>
	<script src="${ctx}/js/plugins/slimscroll/jquery.slimscroll.min.js"></script>
	<script src="${ctx}/js/plugins/layer/layer.min.js"></script>
	<script src="${ctx}/js/hplus.min.js?v=4.1.0"></script>
	<script src="${ctx}/js/contabs.min.js" type="text/javascript"></script>
	<script src="${ctx}/js/plugins/pace/pace.min.js"></script>
	<script src="${ctx}/js/plugins/sweetalert/sweetalert.min.js"></script>
	<script src="${ctx}/js/vue-2.3.4.js"></script>
    <script src="${ctx}/js/jquery-session.js"></script>
	<script type="text/javascript">
	var authorities = '${authorities}';
	(function($){
		$(function(){
			//console.log(authorities);
			$('.safe-logout').click(function () {
				swal({
					title: "您确定要退出登录吗？",
					text: "退出登录后将需要重新登录，请谨慎操作！",
					type: "warning",
					showCancelButton: true,
					confirmButtonColor: "#DD6B55",
					cancelButtonText: "取消",
					confirmButtonText: "退出登录",
					closeOnConfirm: false
				}, function () {
					window.location.href='${contextPath}/openplatformlogout';
				});
			});
			
		});
	})(jQuery);
	
	// 用于子页面转向menu菜单
	function anchorMenuItem(title, url){
		jQuery('#anchorHiddenMenuItem').text(title).attr('href',url).click();
	}
	// 删除指定的页面
	function removeMenuIframePage(menuTabId, frameId){
		var menuTab = jQuery('a.J_menuTab[menu-tab-id="'+menuTabId+'"]');
		var iframePage = jQuery('iframe.J_iframe[frame-id="'+frameId+'"]');
		if(menuTab.attr('data-id') != iframePage.attr('data-id')){
			alert('待删除的页面的tab与iframe页面不匹配，请仔细检查！');
			return false;
		}
		menuTab.remove();
		iframePage.remove();
	}
	</script>

</body>
</html>
